import router from './router'
const whiteList = ['/login'];

router.beforeEach(async (to, from, next) => {
    // document.title = get
    if(hasToken) {
        if(to.path === 'login') {
            next({path: '/'})
        } else {
            // 角色
        }
    } else {
        if (whiteList.indexOf(to.path) !== -1) {
            next()
        } else {
            next('/login')
        }
    }
})

router.afterEach(() => {
    
})